<script setup>
import {onMounted, ref} from "vue";
import {useScoreStore, useUserStore} from "@/store/userStore.js";

let onSubmit = async () => {
  if (useUserStore().search_type === '学号') {
    await useUserStore().updateStudents(1, 5)
  } else if (useUserStore().search_type === '教师号') {
    await useUserStore().updateTeachers(1, 5)
  } else if (useUserStore().search_type === '管理员') {
    await useUserStore().updateAdmins(1, 5)
  }
}

</script>
<template>
  <div class="join">
    <input class="input join-item" :placeholder="'输入' + useUserStore().search_type" v-model="useUserStore().search_username"/>
    <button class="btn join-item rounded-r-full" @click="onSubmit">
      查询
    </button>
  </div>
</template>
<style scoped>

</style>